import Vue from 'vue'
import App from './App.vue'

import axios from 'axios'
import less from 'less'
import qs from 'qs'
//引入路由
import VueRouter from 'vue-router'
//引入vuex
import store from './store'
//按需引入element-ui
import {Button,Drawer,Collapse,CollapseItem,Switch,ColorPicker} from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css';
//引入路由器
import router from './router'
Vue.config.productionTip = false
//main.js中引入：
import VueTouch from 'vue-touch'
Vue.use(VueTouch, {name: 'v-touch'})


//在全局安装axios指令
Vue.prototype.$axios = axios
Vue.prototype.$qs = qs

//使用插件
Vue.use(less)
Vue.use(Button)
Vue.use(Drawer)
Vue.use(VueRouter)
Vue.use(Collapse)
Vue.use(CollapseItem)
Vue.use(Switch)
Vue.use(ColorPicker)

new Vue({
  render: h => h(App),
  beforeCreate(){
    Vue.prototype.$bus = this //安装全局事件总线, $bus就是当前应用的vm
  },
  router:router,
  store:store
}).$mount('#app')
